package com.usian.controller;

import com.usian.pojo.TbItemCat;
import com.usian.service.ItemCateService;
import com.usian.utils.CatResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/service/itemCategory")
public class ItemCateServiceController {
    @Autowired
    ItemCateService itemCateService;
    /**
     * 根据类目 ID 查询当前类目
     * 根据父节点查询子节点
     */
    @RequestMapping("/selectItemCategoryByParentId")
    public List<TbItemCat> selectItemCategoryByParentId(@RequestParam Long
                                                                id) {
        return itemCateService.selectItemCategoryByParentId(id);
    }

}
